home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 276-300 / 280 / cm / cm.h < prev    next >
C/C++ Source or Header  |  1995-03-14  |  52KB  |  2,194 lines

  1.  
  2. /*
  3.  * Celestial Mechanics Simulation Tool
  4.  *
  5.  *    W. John Guineau
  6.  *      3 Royal Crest Drive #9
  7.  *      Marlboro, Mass. 01752
  8.  *      (508) 485-6233
  9.  *
  10.  * Files:
  11.  *        cm.c
  12.  *        cm.h
  13.  *        cm.doc
  14.  *
  15.  * To Compile with Lattice 5.02:
  16.  *
  17.  *        lc -b0  -Lm cm
  18.  *
  19.  *                  NOTICE
  20.  *                  ------ 
  21.  *
  22.  *  I have placed this software in the Public Domain with the
  23.  * condition that all the files remain together and that I remain
  24.  * listed as the original author. This software may not be used for
  25.  * commercial purposes or to make money in any way without expressed
  26.  * written permission from the author (me). I'm including the source
  27.  * code so if you make any significant modifications please concider
  28.  * sending me a copy at the above address. I'd also be interested in
  29.  * any interesting saved setup files you create.
  30.  *
  31.  *
  32.  * This is my first Amiga program so I welcome any comments at all.
  33.  * I wrote this program as both a way to learn the Amiga environment
  34.  * and in response to a conversation I had with a friend on Celestial
  35.  * Mechanics.
  36.  *
  37.  *
  38.  */
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. #define BLKPEN 0
  46. #define WHTPEN 1
  47. #define REDPEN 2
  48. #define ORGPEN 3
  49. #define YLWPEN 4
  50. #define GRNPEN 5
  51. #define BLUPEN 6
  52. #define PURPEN 7
  53.  
  54. #define REQBCK ORGPEN
  55.  
  56. #define SX  640
  57. #define SY  400
  58. #define STE 12
  59. #define SD  3
  60. #define COLORS 8
  61.  
  62. #define PX 220
  63. #define PY STE
  64. #define PW 200
  65. #define PH 12
  66.  
  67.  
  68.  
  69. #define MAX_X 630
  70. #define MAX_Y 340
  71.  
  72.  
  73.  
  74. USHORT    colortable[COLORS] = {
  75.    0x000,            /* BLKPEN */
  76.    0xfff,            /* WHTPEN */
  77.    0xf00,            /* REDPEN */
  78.    0xf90,            /* ORGPEN */
  79.    0xff0,            /* YLWPEN */
  80.    0x0f0,            /* GRNPEN */
  81.    0x00f,            /* BLUPEN */
  82.    0xf0f            /* PURPEN */
  83. };
  84. UWORD    *cp;        /* color palette */
  85.  
  86.  
  87.  
  88. /* 
  89.  * Screen and Windows
  90.  */
  91.  
  92. struct NewScreen ns = {
  93.    0,0,         /* Left, top */
  94.    SX,SY,SD,        /* width,height,depth */
  95.    ORGPEN,WHTPEN,    /* detail and block pens */
  96.    HIRES|LACE,        /* mode (max pixels!) */
  97.    CUSTOMSCREEN,    /* type */
  98.    NULL,        /* fonts? */
  99.    "Celestial Mechanics V1.0",
  100.    NULL,        /* gadgets? */
  101.    NULL         /* bitmap? */
  102.  
  103. };
  104.  
  105.  
  106. #define IDCMPFL (CLOSEWINDOW|MOUSEBUTTONS|MENUPICK|GADGETUP|REQCLEAR)
  107. #define IDCMPFL_MM (CLOSEWINDOW|MOUSEBUTTONS|MENUPICK|GADGETUP|REQCLEAR|MOUSEMOVE)
  108.  
  109.  
  110.  
  111. struct NewWindow nw = {
  112.    0,STE,           /*  Start position */
  113.    SX,SY-STE,           /*  width, height,  */
  114.    BLKPEN,WHTPEN,       /*  detail, block pens */
  115.                         /*  IDCMP flags */
  116.    IDCMPFL,
  117.  
  118.    GIMMEZEROZERO
  119.  | ACTIVATE
  120.  | REPORTMOUSE
  121.  | WINDOWCLOSE
  122.  | SMART_REFRESH,
  123.  
  124.    NULL,           /* First gadget in list */
  125.    NULL,           /* User checkmark  */
  126.    "Gravitational Behaviour",/* Window Title */
  127.    NULL,           /* Pointer to screen (Set later) */
  128.    NULL,           /* Pointer to superbitmap  */
  129.    0,0,0,0,               /* Ignored because not sizeable */
  130.    CUSTOMSCREEN        /* on our own screen */
  131. };
  132.  
  133. struct NewWindow npw = {
  134.    PX,PY,           /*  Start position */
  135.    PW,PH,           /*  width, height,  */
  136.    ORGPEN,REDPEN,       /*  detail, block pens */
  137.  
  138.    NULL,           /* IDCMP flags */
  139.  
  140.    BORDERLESS
  141.  | NOCAREREFRESH,
  142.  
  143.    NULL,           /* First gadget in list */
  144.    NULL,           /* User checkmark  */
  145.    NULL,                   /* Window Title */
  146.    NULL,           /* Pointer to screen (Set later) */
  147.    NULL,           /* Pointer to superbitmap  */
  148.    0,0,0,0,            /* Ignored because not sizeable */
  149.    CUSTOMSCREEN        /* on our own screen */
  150. };
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157. /*
  158.  *    Text Attributes
  159.  */
  160. char def_font[] ="topaz.font";
  161.  
  162. struct TextAttr TxtAt_Plain = { 
  163.    (UBYTE *)def_font,
  164.    8,
  165.    FS_NORMAL,
  166.    FPF_ROMFONT
  167. };
  168.  
  169. struct TextAttr TxtAt_BIU = {
  170.    (UBYTE *)def_font, 
  171.    8,
  172.    FSF_BOLD | FSF_ITALIC | FSF_UNDERLINED,
  173.    FPF_ROMFONT
  174. };
  175.  
  176. struct TextAttr TxtAt_BU = {
  177.    (UBYTE *)def_font,
  178.    8,
  179.    FSF_BOLD | FSF_UNDERLINED,
  180.    FPF_ROMFONT
  181. };
  182.  
  183. struct TextAttr TxtAt_BI = {
  184.    (UBYTE *)def_font,
  185.    8,
  186.    FSF_BOLD | FSF_ITALIC,
  187.    FPF_ROMFONT
  188. };
  189.  
  190. struct TextAttr TxtAt_B ={
  191.    (UBYTE *)def_font,
  192.    8,
  193.    FSF_BOLD,
  194.    FPF_ROMFONT
  195. };
  196.  
  197. struct TextAttr TxtAt_IU ={
  198.    (UBYTE *)def_font,
  199.    8,
  200.    FSF_ITALIC | FSF_UNDERLINED,
  201.    FPF_ROMFONT
  202. };
  203.  
  204. struct TextAttr TxtAt_I ={
  205.    (UBYTE *)def_font,
  206.    8,
  207.    FSF_ITALIC,
  208.    FPF_ROMFONT
  209. };
  210.  
  211. struct TextAttr TxtAt_U ={
  212.    (UBYTE *)def_font,
  213.    8,
  214.    FSF_UNDERLINED,
  215.    FPF_ROMFONT
  216. };
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223. /**************************************
  224.  *   Gadgets 
  225.  **************************************/
  226.  
  227. /*
  228.  *  Gadget ID numbers
  229.  */
  230. #define NAMEGAD       1
  231. #define RADIUSGAD     2
  232. #define MASSGAD       3
  233. #define VELOCITYGAD   4
  234. #define DIRECTIONGAD  5
  235. #define OKGAD          6
  236. #define CANCELGAD     7
  237. #define RESETGAD      8
  238. #define GGAD          9
  239. #define DTGAD         10
  240. #define TGAD          11
  241. #define DSGAD         12
  242. #define TLGAD         13
  243. #define COLOR1GAD     14
  244. #define COLOR2GAD     15
  245. #define COLOR3GAD     16
  246. #define COLOR4GAD     17
  247. #define COLOR5GAD     18
  248. #define COLOR6GAD     19
  249. #define COLOR7GAD     20
  250. #define FNGAD         21
  251. #define FNOKGAD          22
  252. #define FNCANGAD      23
  253. #define STGAD          24
  254. #define FXGAD          25
  255. #define AOKGAD          26
  256.  
  257.  
  258.  
  259. /*
  260.  * Some common gadget stuff 
  261.  */
  262. struct IntuiText yes_text = {
  263.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  264.    JAM1,                /* DrawMode */
  265.    3,3,                 /* LeftEdge, TopEdge */
  266.    &TxtAt_Plain,            /* TextAttr */
  267.    "Yes",                                /* IText */
  268.    NULL                 /* NextText */
  269. };
  270.  
  271. struct IntuiText no_text = {
  272.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  273.    JAM1,                /* DrawMode */
  274.    7,3,                 /* LeftEdge, TopEdge */
  275.    &TxtAt_Plain,            /* TextAttr */
  276.    "No",                                /* IText */
  277.    NULL                 /* NextText */
  278. };
  279.  
  280.  
  281. /*
  282.  *     cancel gadget
  283.  */
  284.  
  285. SHORT cancel_Pairs[] = {
  286.    0, 0,
  287.    68,0,
  288.    68,22,
  289.    0, 22,
  290.    0, 0
  291. };
  292.  
  293. struct Border cancel_bord = {
  294.    -1,    -1,                /* LeftEdge, TopEdge */
  295.    REDPEN,REDPEN,JAM2,            /* FrontPen, BackPen, DrawMode */
  296.    5,                    /* Count of XY pairs */
  297.    (SHORT *)&cancel_Pairs,              /* XY pairs */
  298.    NULL                 /* Next Border */
  299. };
  300.  
  301. char    *cantxt="CANCEL";        /* This gad is either CAN or DEL */
  302. char    *deltxt="DELETE";
  303.  
  304. struct IntuiText cancel_text = {
  305.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  306.    JAM1,                /* DrawMode */
  307.    9,8,                 /* LeftEdge, TopEdge */
  308.    &TxtAt_Plain,            /* TextAttr */
  309.    NULL,                                /* IText */
  310.    NULL                 /* NextText */
  311. };
  312.  
  313. struct Gadget cancel = {
  314.    NULL,            /* NextGadget pointer */
  315.    130, 115,            /* LeftEdge, TopEdge  */
  316.    68, 22,            /* Width, Height      */
  317.                 /* Gadget Flags */
  318.    GADGHCOMP,
  319.                 /* Activation Flags */
  320.    RELVERIFY
  321.  | ENDGADGET,
  322.                 /* GadgetType */
  323.    BOOLGADGET
  324.  | REQGADGET,
  325.    (APTR)&cancel_bord,          /* GadgetRender */
  326.    NULL,            /* SelectRender */
  327.    &cancel_text,        /* GadgetText */
  328.    0x0,             /* MutualExclude */
  329.    NULL,            /* SpecialInfo */
  330.    CANCELGAD,            /* GadgetID        */
  331.    NULL             /* UserData Pointer */
  332. };
  333.  
  334.  
  335. /*
  336.  *     ok gadget
  337.  */
  338.  
  339. SHORT ok_Pairs[] = {
  340.    0, 0,
  341.    30,0,
  342.    30,22,
  343.    0, 22,
  344.    0, 0
  345. };
  346.  
  347. struct Border ok_bord = {
  348.    -1,    -1,               /* LeftEdge, TopEdge */
  349.    GRNPEN,REDPEN,JAM2,           /* FrontPen, BackPen, DrawMode*/
  350.    5,                   /* Count of XY p    airs */
  351.    (SHORT *)&ok_Pairs,         /* XY pairs */
  352.    NULL                /* Next Border */
  353. };
  354.  
  355. struct IntuiText ok_text = {
  356.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  357.    JAM1,                /* DrawMode */
  358.    5,7,                 /* LeftEdge, TopEdge */
  359.    &TxtAt_Plain,            /* TextAttr */
  360.    "OK",                                /* IText */
  361.    NULL                 /* NextText */
  362. };
  363.  
  364.  
  365. struct Gadget ok = {
  366.    &cancel,              /* NextGadget pointer */
  367.    15, 115,              /* LeftEdge, TopEdge    */
  368.    30, 22,              /* Width, Height    */
  369.                   /* Gadget Flags */
  370.    GADGHCOMP,
  371.                   /* Activation Flags */
  372.    RELVERIFY
  373.  | ENDGADGET,
  374.                   /* GadgetType */
  375.    BOOLGADGET
  376.  | REQGADGET,
  377.    (APTR)&ok_bord,                /*  GadgetRender */
  378.    NULL,              /* SelectRender */
  379.    &ok_text,              /* GadgetText */
  380.    0x0,               /* MutualExclude */
  381.    NULL,              /* SpecialInfo */
  382.    OKGAD,              /* GadgetID          */
  383.    NULL               /* UserData Pointer */
  384. };
  385.  
  386.  
  387.  
  388.  
  389. /*
  390.  *     reset gadget
  391.  */
  392.  
  393. SHORT reset_Pairs[] = {
  394.    0, 0,
  395.    51,0,
  396.    51,22,
  397.    0, 22,
  398.    0, 0
  399. };
  400.  
  401. struct Border reset_bord = {
  402.    -1,    -1,               /* LeftEdge, TopEdge */
  403.    YLWPEN,REDPEN,JAM2,           /* FrontPen, BackPen, DrawMode*/
  404.    5,                   /* Count of XY pairs */
  405.    (SHORT *)&reset_Pairs,      /* XY pairs */
  406.    NULL                /* Next Border */
  407. };
  408.  
  409. struct IntuiText reset_text = {
  410.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  411.    JAM1,                /* DrawMode */
  412.    5,7,                  /* LeftEdge, TopEdge */
  413.    &TxtAt_Plain,            /* TextAttr */
  414.    "RESET",                             /* IText */
  415.    NULL                 /* NextText */
  416. };
  417.  
  418.  
  419. struct Gadget reset = {
  420.    &ok,                       /* NextGadget pointer */
  421.    60, 115,              /* LeftEdge, TopEdge    */
  422.    51, 22,              /* Width, Height    */
  423.                   /* Gadget Flags */
  424.    GADGHCOMP,
  425.                   /* Activation Flags */
  426.    RELVERIFY,
  427.                   /* GadgetType */
  428.    BOOLGADGET
  429.  | REQGADGET,
  430.    (APTR)&reset_bord,             /*  GadgetRender */
  431.    NULL,              /* SelectRender */
  432.    &reset_text,              /* GadgetText */
  433.    0x0,               /* MutualExclude */
  434.    NULL,              /* SpecialInfo */
  435.    RESETGAD,              /* GadgetID          */
  436.    NULL               /* UserData Pointer */
  437. };
  438.  
  439.  
  440.  
  441. /****************************************************
  442.  *  Gadgets in Body Requestor
  443.  ****************************************************/
  444.  
  445.  
  446.  
  447.  
  448. /*
  449.  *    Text for x,y printout in Body req
  450.  */
  451. char    xy_buf[80];
  452. struct IntuiText xy_text = {
  453.    BLUPEN,WHTPEN,            /* FrontPen, BackPen */
  454.    JAM2,                /* DrawMode */
  455.    15,96,                /* LeftEdge, TopEdge */
  456.    &TxtAt_Plain,            /* TextAttr */
  457.    xy_buf,                              /* IText */
  458.    NULL                 /* NextText */
  459. };
  460.  
  461.  
  462.  
  463. /*
  464.  *     Fixed gadget
  465.  */
  466.  
  467. struct Image fx_image = {
  468.     0,0,                /* relative to select box */
  469.     30,11,                /* same size as select box */
  470.     SD,                /* planes deep as screen */
  471.     NULL,                /* image data, but we don't need it */
  472.     0x00,                /* planepick- none */
  473.     BLUPEN,                /* planeonoff */
  474.     NULL                /* next image, none */
  475. };
  476.  
  477. struct IntuiText fx_text = {
  478.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  479.    JAM1,                /* DrawMode */
  480.    10,82,                /* LeftEdge, TopEdge */
  481.    &TxtAt_Plain,            /* TextAttr */
  482.    "Fixed",                             /* IText */
  483.    &xy_text                 /* NextText */
  484. };
  485.  
  486.  
  487. struct Gadget fixed = {
  488.    &reset,                  /* NextGadget pointer */
  489.    140, 80,                 /* LeftEdge, TopEdge  */
  490.    30, 11,                 /* Width, Height       */
  491.                      /* Gadget Flags */
  492.    GADGHNONE
  493.  | GADGIMAGE,
  494.                         /* Activation Flags */
  495.    TOGGLESELECT
  496.  | RELVERIFY,
  497.  
  498.    BOOLGADGET                 /* GadgetType */
  499.  | REQGADGET,
  500.    (APTR)&fx_image,                  /* GadgetRender */
  501.    NULL,                 /* SelectRender */
  502.    &no_text,                 /* GadgetText */
  503.    0x0,                  /* MutualExclude */
  504.    NULL,                             /* SpecialInfo */
  505.    FXGAD,                         /* GadgetID     */
  506.    NULL                  /* UserData Pointer */
  507. };
  508.  
  509.  
  510. /*
  511.  *     Color gadgets
  512.  */
  513.  
  514. struct IntuiText color_text = {
  515.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  516.    JAM1,                /* DrawMode */
  517.    10,65,                /* LeftEdge, TopEdge */
  518.    &TxtAt_Plain,            /* TextAttr */
  519.    "COLOR",                             /* IText */
  520.    &fx_text                 /* NextText */
  521. };
  522.  
  523.  
  524. struct Image color1_image = {
  525.     0,0,                /* relative to select box */
  526.     10,11,                /* same size as select box */
  527.     SD,                /* planes deep as screen */
  528.     NULL,                /* image data, but we don't need it */
  529.     0x00,                /* planepick- none */
  530.     0x1,                /* planeonoff */
  531.     NULL                /* next image, none */
  532.     };
  533.  
  534.  
  535. struct Gadget color1 = {
  536.    &fixed,                  /* NextGadget pointer */
  537.    119, 63,                 /* LeftEdge, TopEdge  */
  538.    10, 11,                 /* Width, Height       */
  539.                      /* Gadget Flags */
  540.    GADGHCOMP
  541.  | GADGIMAGE,
  542.                         /* Activation Flags */
  543.    RELVERIFY,
  544.                      /* GadgetType */
  545.    BOOLGADGET
  546.  | REQGADGET,
  547.    (APTR)&color1_image,              /* GadgetRender */
  548.    NULL,                 /* SelectRender */
  549.    NULL,                 /* GadgetText */
  550.    0x0,                  /* MutualExclude */
  551.    NULL,                             /* SpecialInfo */
  552.    COLOR1GAD,                        /* GadgetID */
  553.    (APTR)WHTPEN              /* UserData Pointer */
  554. };
  555.  
  556.  
  557. struct Image color2_image = {
  558.     0,0,                /* relative to select box */
  559.     10,11,                /* same size as select box */
  560.     SD,                /* planes deep as screen */
  561.     NULL,                /* image data, but we don't need it */
  562.     0x00,                /* planepick- none */
  563.     0x2,                /* planeonoff */
  564.     NULL                /* next image, none */
  565.     };
  566.  
  567.  
  568. struct Gadget color2 = {
  569.    &color1,                  /* NextGadget pointer */
  570.    129, 63,                 /* LeftEdge, TopEdge  */
  571.    10, 11,                 /* Width, Height       */
  572.                      /* Gadget Flags */
  573.    GADGHCOMP
  574.  | GADGIMAGE,
  575.                         /* Activation Flags */
  576.    RELVERIFY,
  577.                      /* GadgetType */
  578.    BOOLGADGET
  579.  | REQGADGET,
  580.    (APTR)&color2_image,              /* GadgetRender */
  581.    NULL,                 /* SelectRender */
  582.    NULL,                 /* GadgetText */
  583.    0x0,                  /* MutualExclude */
  584.    NULL,                             /* SpecialInfo */
  585.    COLOR2GAD,                        /* GadgetID */
  586.    (APTR)REDPEN              /* UserData Pointer */
  587. };
  588.  
  589.  
  590. struct Image color3_image = {
  591.     0,0,                /* relative to select box */
  592.     10,11,                /* same size as select box */
  593.     SD,                /* planes deep as screen */
  594.     NULL,                /* image data, but we don't need it */
  595.     0x00,                /* planepick- none */
  596.     0x3,                /* planeonoff */
  597.     NULL                /* next image, none */
  598.     };
  599.  
  600.  
  601. struct Gadget color3 = {
  602.    &color2,                  /* NextGadget pointer */
  603.    139, 63,                 /* LeftEdge, TopEdge  */
  604.    10, 11,                 /* Width, Height       */
  605.                      /* Gadget Flags */
  606.    GADGHCOMP
  607.  | GADGIMAGE,
  608.                         /* Activation Flags */
  609.    RELVERIFY,
  610.                      /* GadgetType */
  611.    BOOLGADGET
  612.  | REQGADGET,
  613.    (APTR)&color3_image,              /* GadgetRender */
  614.    NULL,                 /* SelectRender */
  615.    NULL,                 /* GadgetText */
  616.    0x0,                  /* MutualExclude */
  617.    NULL,                             /* SpecialInfo */
  618.    COLOR3GAD,                        /* GadgetID */
  619.    (APTR)ORGPEN              /* UserData Pointer */
  620. };
  621.  
  622.  
  623. struct Image color4_image = {
  624.     0,0,                /* relative to select box */
  625.     10,11,                /* same size as select box */
  626.     SD,                /* planes deep as screen */
  627.     NULL,                /* image data, but we don't need it */
  628.     0x00,                /* planepick- none */
  629.     0x4,                /* planeonoff */
  630.     NULL                /* next image, none */
  631.     };
  632.  
  633.  
  634. struct Gadget color4 = {
  635.    &color3,                  /* NextGadget pointer */
  636.    149, 63,                 /* LeftEdge, TopEdge  */
  637.    10, 11,                 /* Width, Height       */
  638.                      /* Gadget Flags */
  639.    GADGHCOMP
  640.  | GADGIMAGE,
  641.                         /* Activation Flags */
  642.    RELVERIFY,
  643.                      /* GadgetType */
  644.    BOOLGADGET
  645.  | REQGADGET,
  646.    (APTR)&color4_image,              /* GadgetRender */
  647.    NULL,                 /* SelectRender */
  648.    NULL,                 /* GadgetText */
  649.    0x0,                  /* MutualExclude */
  650.    NULL,                             /* SpecialInfo */
  651.    COLOR4GAD,                        /* GadgetID */
  652.    (APTR)YLWPEN              /* UserData Pointer */
  653. };
  654.  
  655.  
  656. struct Image color5_image = {
  657.     0,0,                /* relative to select box */
  658.     10,11,                /* same size as select box */
  659.     SD,                /* planes deep as screen */
  660.     NULL,                /* image data, but we don't need it */
  661.     0x00,                /* planepick- none */
  662.     0x5,                /* planeonoff */
  663.     NULL                /* next image, none */
  664.     };
  665.  
  666.  
  667. struct Gadget color5 = {
  668.    &color4,                  /* NextGadget pointer */
  669.    159, 63,                 /* LeftEdge, TopEdge  */
  670.    10, 11,                 /* Width, Height       */
  671.                      /* Gadget Flags */
  672.    GADGHCOMP
  673.  | GADGIMAGE,
  674.                         /* Activation Flags */
  675.    RELVERIFY,
  676.                      /* GadgetType */
  677.    BOOLGADGET
  678.  | REQGADGET,
  679.    (APTR)&color5_image,              /* GadgetRender */
  680.    NULL,                 /* SelectRender */
  681.    NULL,                 /* GadgetText */
  682.    0x0,                  /* MutualExclude */
  683.    NULL,                             /* SpecialInfo */
  684.    COLOR5GAD,                        /* GadgetID */
  685.    (APTR)GRNPEN              /* UserData Pointer */
  686. };
  687.  
  688.  
  689. struct Image color6_image = {
  690.     0,0,                /* relative to select box */
  691.     10,11,                /* same size as select box */
  692.     SD,                /* planes deep as screen */
  693.     NULL,                /* image data, but we don't need it */
  694.     0x00,                /* planepick- none */
  695.     0x6,                /* planeonoff */
  696.     NULL                /* next image, none */
  697.     };
  698.  
  699.  
  700. struct Gadget color6 = {
  701.    &color5,                  /* NextGadget pointer */
  702.    169, 63,                 /* LeftEdge, TopEdge  */
  703.    10, 11,                 /* Width, Height       */
  704.                      /* Gadget Flags */
  705.    GADGHCOMP
  706.  | GADGIMAGE,
  707.                         /* Activation Flags */
  708.    RELVERIFY,
  709.                      /* GadgetType */
  710.    BOOLGADGET
  711.  | REQGADGET,
  712.    (APTR)&color6_image,              /* GadgetRender */
  713.    NULL,                 /* SelectRender */
  714.    NULL,                 /* GadgetText */
  715.    0x0,                  /* MutualExclude */
  716.    NULL,                             /* SpecialInfo */
  717.    COLOR6GAD,                        /* GadgetID */
  718.    (APTR)BLUPEN              /* UserData Pointer */
  719. };
  720.  
  721.  
  722. struct Image color7_image = {
  723.     0,0,                /* relative to select box */
  724.     10,11,                /* same size as select box */
  725.     SD,                /* planes deep as screen */
  726.     NULL,                /* image data, but we don't need it */
  727.     0x00,                /* planepick- none */
  728.     0x7,                /* planeonoff */
  729.     NULL                /* next image, none */
  730.     };
  731.  
  732.  
  733. struct Gadget color7 = {
  734.    &color6,                  /* NextGadget pointer */
  735.    179, 63,                 /* LeftEdge, TopEdge  */
  736.    10, 11,                 /* Width, Height       */
  737.                      /* Gadget Flags */
  738.    GADGHCOMP
  739.  | GADGIMAGE,
  740.                         /* Activation Flags */
  741.    RELVERIFY,
  742.                      /* GadgetType */
  743.    BOOLGADGET
  744.  | REQGADGET,
  745.    (APTR)&color7_image,              /* GadgetRender */
  746.    NULL,                 /* SelectRender */
  747.    NULL,                 /* GadgetText */
  748.    0x0,                  /* MutualExclude */
  749.    NULL,                             /* SpecialInfo */
  750.    COLOR7GAD,                        /* GadgetID */
  751.    (APTR)PURPEN              /* UserData Pointer */
  752. };
  753.  
  754.  
  755.  
  756. /*
  757.  *     direction gadget
  758.  */
  759.  
  760. SHORT direction_Pairs[] = {
  761.    0, 0,
  762.    90,0,
  763.    90,13,
  764.    0, 13,
  765.    0, 0
  766. };
  767.  
  768. struct Border direction_bord = {
  769.    -1,    -3,                /* LeftEdge, TopEdge */
  770.    WHTPEN,REDPEN,JAM2,            /* FrontPen, BackPen, DrawMode*/
  771.    5,                    /* Count of XY pairs */
  772.    (SHORT *)&direction_Pairs,       /* XY pairs */
  773.    NULL                 /* Next Border */
  774. };
  775.  
  776. struct IntuiText dir_text = {
  777.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  778.    JAM1,                /* DrawMode */
  779.    10,47,                /* LeftEdge, TopEdge */
  780.    &TxtAt_Plain,            /* TextAttr */
  781.    "DIRECTION",                         /* IText */
  782.    &color_text                 /* NextText */
  783. };
  784.  
  785.  
  786. UBYTE direction_sbuf[12] = "0";
  787. UBYTE direction_ubuf[12];
  788.  
  789. struct StringInfo direction_txstr = {
  790.    direction_sbuf, direction_ubuf,      /* Buffer, UndoBuffer  */
  791.    0, 12, 0,                  /* BufferPos, MaxChars, DispPos */
  792.    0, 1,                  /* UndoPos, NumChars */
  793.    0, 0, 0,                  /* DispCount, CLeft, CTop */
  794.    0x0, 0,                  /* LayerPtr, LongInt */
  795.    NULL                   /* AltKeyMap */
  796. };
  797.  
  798. struct Gadget direction = {
  799.    &color7,                  /* NextGadget pointer */
  800.    110, 45,                 /* LeftEdge, TopEdge  */
  801.    88, 11,                 /* Width, Height       */
  802.                      /* Gadget Flags */
  803.    GADGHCOMP,
  804.                      /* Activation Flags */
  805.    RELVERIFY
  806.  | LONGINT
  807.  | STRINGCENTER,
  808.                      /* GadgetType */
  809.    STRGADGET
  810.  | REQGADGET,
  811.    (APTR)&direction_bord,            /* GadgetRender */
  812.    NULL,                 /* SelectRender */
  813.    NULL,                 /* GadgetText */
  814.    0x0,                  /* MutualExclude */
  815.    (APTR)&direction_txstr,           /* SpecialInfo */
  816.    DIRECTIONGAD,             /* GadgetID     */
  817.    NULL                  /* UserData Pointer */
  818. };
  819.  
  820.  
  821. /*
  822.  *      velocity gadget
  823.  */
  824.  
  825. SHORT velocity_Pairs[] = {
  826.    0, 0,
  827.    90,0,
  828.    90,13,
  829.    0, 13,
  830.    0, 0
  831. };
  832.  
  833. struct Border velocity_bord = {
  834.    -1,    -3,                 /* LeftEdge, TopEdge */
  835.    WHTPEN,REDPEN,JAM2,             /* FrontPen, BackPen, DrawMode*/
  836.    5,                     /* Count of XY pairs */
  837.    (SHORT *)&velocity_Pairs,         /* XY pairs */
  838.    NULL                  /* Next Border */
  839. };
  840.  
  841. struct IntuiText vel_text = {
  842.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  843.    JAM1,                /* DrawMode */
  844.    10,34,                /* LeftEdge, TopEdge */
  845.    &TxtAt_Plain,            /* TextAttr */
  846.    "VELOCITY",                          /* IText */
  847.    &dir_text                /* NextText */
  848. };
  849.  
  850.  
  851. UBYTE velocity_sbuf[20] = "0.0e0";
  852. UBYTE velocity_ubuf[20];
  853.  
  854. struct StringInfo velocity_txstr = {
  855.    velocity_sbuf, velocity_ubuf,       /* Buffer, UndoBuffer  */
  856.    0, 20, 0,                   /* BufferPos, MaxChars, DispPos */
  857.    0, 5,                   /* UndoPos, NumChars */
  858.    0, 0, 0,                   /* DispCount, CLeft, CTop */
  859.    0x0, 0,                   /* LayerPtr, LongInt */
  860.    NULL                    /* AltKeyMap */
  861. };
  862.  
  863.  
  864. struct Gadget velocity = {
  865.    &direction,            /* NextGadget pointer */
  866.    110, 32,            /* LeftEdge, TopEdge  */
  867.    88, 11,            /* Width, Height      */
  868.                 /* Gadget Flags */
  869.    GADGHCOMP,
  870.                 /* Activation Flags */
  871.    RELVERIFY
  872.  | STRINGCENTER,
  873.                 /* GadgetType */
  874.    STRGADGET
  875.  | REQGADGET,
  876.    (APTR)&velocity_bord,        /*  GadgetRender */
  877.    NULL,            /* SelectRender */
  878.    NULL,            /* GadgetText */
  879.    0x0,             /* MutualExclude */
  880.    (APTR)&velocity_txstr,       /* SpecialInfo */
  881.    VELOCITYGAD,         /* GadgetID */
  882.    NULL             /* UserData Pointer */
  883. };
  884.  
  885.  
  886. /*
  887.  *    name gadget
  888.  */
  889.  
  890. SHORT name_Pairs[] = {
  891.    0, 0,
  892.    90,0,
  893.    90,13,
  894.    0, 13,
  895.    0, 0
  896. };
  897.  
  898. struct Border name_bord = {
  899.    -1,    -3,              /* LeftEdge, TopEdge */
  900.    WHTPEN,REDPEN,JAM2,          /* FrontPen, BackPen, DrawMode*/
  901.    5,                  /* Count of XY pairs */
  902.    (SHORT *)&name_Pairs,          /* XY pairs */
  903.    NULL               /* Next Border */
  904. };
  905.  
  906. struct IntuiText name_text = {
  907.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  908.    JAM1,                /* DrawMode */
  909.    10,8,                                /* LeftEdge, TopEdge */
  910.    &TxtAt_Plain,            /* TextAttr */
  911.    "NAME",                              /* IText */
  912.    &vel_text                /* NextText */
  913. };
  914.  
  915. UBYTE name_sbuf[12] = "SUN";
  916. UBYTE name_ubuf[12];
  917.  
  918. struct StringInfo name_txstr = {
  919.    name_sbuf, name_ubuf,            /* Buffer, UndoBuffer */
  920.    0, 12, 0,                /* BufferPos, MaxChars, DispPos */
  921.    0, 3,                /* UndoPos, NumChars */
  922.    0, 0, 0,                /* DispCount, CLeft, CTop */
  923.    0x0, 0,                /* LayerPtr, LongInt */
  924.    NULL                 /* AltKeyMap */
  925. };
  926.  
  927. struct Gadget name= {
  928.    &velocity,            /* NextGadget pointer */
  929.    110, 6,            /* LeftEdge, TopEdge  */
  930.    88, 11,            /* Width, Height      */
  931.                 /* Gadget Flags */
  932.    GADGHCOMP,
  933.                 /* Activation Flags */
  934.    RELVERIFY
  935.  | STRINGCENTER,
  936.                 /* GadgetType */
  937.    STRGADGET
  938.  | REQGADGET,
  939.    (APTR)&name_bord,            /* GadgetRender */
  940.    NULL,            /* SelectRender */
  941.    NULL,            /* GadgetText */
  942.    0x0,             /* MutualExclude */
  943.    (APTR)&name_txstr,           /* SpecialInfo */
  944.    NAMEGAD,               /* GadgetID */
  945.    NULL             /* UserData Pointer */
  946. };
  947.  
  948.  
  949.  
  950.  
  951. /*
  952.  *      mass gadget
  953.  */
  954.  
  955. SHORT mass_Pairs[] = {
  956.    0, 0,
  957.    90,0,
  958.    90,13,
  959.    0, 13,
  960.    0, 0
  961. };
  962.  
  963. struct Border mass_bord = {
  964.    -1,    -3,              /* LeftEdge, TopEdge */
  965.    WHTPEN,REDPEN,JAM2,          /* FrontPen, BackPen, DrawMode*/
  966.    5,                  /* Count of XY pairs */
  967.    (SHORT *)&mass_Pairs,          /* XY pairs */
  968.    NULL               /* Next Border */
  969. };
  970.  
  971. struct IntuiText mass_text = {
  972.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  973.    JAM1,                /* DrawMode */
  974.    10,21,                /* LeftEdge, TopEdge */
  975.    &TxtAt_Plain,            /* TextAttr */
  976.    "MASS",                              /* IText */
  977.    &name_text             /* NextText */
  978. };
  979.  
  980. UBYTE mass_sbuf[20] = "1.0e0";
  981. UBYTE mass_ubuf[20];
  982.  
  983. struct StringInfo mass_txstr = {
  984.    mass_sbuf, mass_ubuf,        /* Buffer, UndoBuffer */
  985.    0, 20, 0,                /* BufferPos, MaxChars, DispPos */
  986.    0, 5,                /* UndoPos, NumChars */
  987.    0, 0, 0,                /* DispCount, CLeft, CTop */
  988.    0x0, 1,                /* LayerPtr, LongInt */
  989.    NULL                 /* AltKeyMap */
  990. };
  991.  
  992. struct Gadget mass = {
  993.    &name,            /* NextGadget pointer */
  994.    110, 19,            /* LeftEdge, TopEdge  */
  995.    88, 11,            /* Width, Height      */
  996.                 /* Gadget Flags */
  997.    GADGHCOMP,
  998.                 /* Activation Flags */
  999.    RELVERIFY
  1000.  | STRINGCENTER,
  1001.                 /* GadgetType */
  1002.    STRGADGET
  1003.  | REQGADGET,
  1004.    (APTR)&mass_bord,            /* GadgetRender */
  1005.    NULL,            /* SelectRender */
  1006.    NULL,            /* GadgetText */
  1007.    0x0,             /* MutualExclude */
  1008.    (APTR)&mass_txstr,           /* SpecialInfo */
  1009.    MASSGAD,            /* GadgetID */
  1010.    NULL             /* UserData Pointer */
  1011. };
  1012.  
  1013.  
  1014.  
  1015. /****************************************************
  1016.  *  Gadgets in Setup Requestor
  1017.  ****************************************************/
  1018.  
  1019.  
  1020. /*
  1021.  *     ShowTime gadget
  1022.  */
  1023.  
  1024. struct Image st_image = {
  1025.     0,0,                /* relative to select box */
  1026.     30,11,                /* same size as select box */
  1027.     SD,                /* planes deep as screen */
  1028.     NULL,                /* image data, but we don't need it */
  1029.     0x00,                /* planepick- none */
  1030.     BLUPEN,                /* planeonoff */
  1031.     NULL                /* next image, none */
  1032. };
  1033.  
  1034. struct IntuiText st_text = {
  1035.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1036.    JAM1,                /* DrawMode */
  1037.    10,98,                /* LeftEdge, TopEdge */
  1038.    &TxtAt_Plain,            /* TextAttr */
  1039.    "ShowTime",                          /* IText */
  1040.    NULL                 /* NextText */
  1041. };
  1042.  
  1043.  
  1044. struct Gadget st = {
  1045.    &reset,                  /* NextGadget pointer */
  1046.    145, 96,                 /* LeftEdge, TopEdge  */
  1047.    30, 11,                 /* Width, Height       */
  1048.                      /* Gadget Flags */
  1049.    GADGHNONE
  1050.  | GADGIMAGE,
  1051.                         /* Activation Flags */
  1052.    TOGGLESELECT
  1053.  | RELVERIFY,
  1054.  
  1055.    BOOLGADGET                 /* GadgetType */
  1056.  | REQGADGET,
  1057.    (APTR)&st_image,                  /* GadgetRender */
  1058.    NULL,                 /* SelectRender */
  1059.    &no_text,                 /* GadgetText */
  1060.    0x0,                  /* MutualExclude */
  1061.    NULL,                             /* SpecialInfo */
  1062.    STGAD,                         /* GadgetID     */
  1063.    NULL                  /* UserData Pointer */
  1064. };
  1065.  
  1066.  
  1067. /*
  1068.  *     TrailLength gadget
  1069.  */
  1070.  
  1071. SHORT tl_Pairs[] = {
  1072.    0, 0,
  1073.    90,0,
  1074.    90,13,
  1075.    0, 13,
  1076.    0, 0
  1077. };
  1078.  
  1079. struct Border tl_bord = {
  1080.    -1,    -3,                /* LeftEdge, TopEdge */
  1081.    WHTPEN,REDPEN,JAM2,            /* FrontPen, BackPen, DrawMode*/
  1082.    5,                    /* Count of XY pairs */
  1083.    (SHORT *)&tl_Pairs,              /* XY pairs */
  1084.    NULL                 /* Next Border */
  1085. };
  1086.  
  1087.  
  1088. UBYTE tl_sbuf[20] = "0";
  1089. UBYTE tl_ubuf[20];
  1090.  
  1091. struct StringInfo tl_txstr = {
  1092.    tl_sbuf, tl_ubuf,                        /* Buffer, UndoBuffer  */
  1093.    0, 20, 0,                  /* BufferPos, MaxChars, DispPos */
  1094.    0, 1,                  /* UndoPos, NumChars */
  1095.    0, 0, 0,                  /* DispCount, CLeft, CTop */
  1096.    0x0, 1,                  /* LayerPtr, LongInt */
  1097.    NULL                   /* AltKeyMap */
  1098. };
  1099.  
  1100. struct IntuiText tl_text = {
  1101.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1102.    JAM1,                /* DrawMode */
  1103.    10,60,                /* LeftEdge, TopEdge */
  1104.    &TxtAt_Plain,            /* TextAttr */
  1105.    "TrailLength",                       /* IText */
  1106.    &st_text                  /* NextText */
  1107. };
  1108.  
  1109.  
  1110. struct Gadget tl = {
  1111.    &st,                  /* NextGadget pointer */
  1112.    110, 58,                 /* LeftEdge, TopEdge  */
  1113.    88, 11,                 /* Width, Height       */
  1114.                      /* Gadget Flags */
  1115.    GADGHCOMP,
  1116.                         /* Activation Flags */
  1117.    RELVERIFY
  1118.  | LONGINT
  1119.  | STRINGCENTER,
  1120.                      /* GadgetType */
  1121.        STRGADGET
  1122.  | REQGADGET,
  1123.    (APTR)&tl_bord,                   /* GadgetRender */
  1124.    NULL,                 /* SelectRender */
  1125.    NULL,                 /* GadgetText */
  1126.    0x0,                  /* MutualExclude */
  1127.    (APTR)&tl_txstr,                  /* SpecialInfo */
  1128.    TLGAD,                         /* GadgetID     */
  1129.    NULL                  /* UserData Pointer */
  1130. };
  1131.  
  1132.  
  1133. /*
  1134.  *     ds (Delta S) gadget
  1135.  */
  1136.  
  1137. SHORT ds_Pairs[] = {
  1138.    0, 0,
  1139.    90,0,
  1140.    90,13,
  1141.    0, 13,
  1142.    0, 0
  1143. };
  1144.  
  1145. struct Border ds_bord = {
  1146.    -1,    -3,                /* LeftEdge, TopEdge */
  1147.    WHTPEN,REDPEN,JAM2,            /* FrontPen, BackPen, DrawMode*/
  1148.    5,                    /* Count of XY pairs */
  1149.    (SHORT *)&ds_Pairs,              /* XY pairs */
  1150.    NULL                 /* Next Border */
  1151. };
  1152.  
  1153. struct IntuiText ds_text = {
  1154.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1155.    JAM1,                /* DrawMode */
  1156.    10,47,                /* LeftEdge, TopEdge */
  1157.    &TxtAt_Plain,            /* TextAttr */
  1158.    "Units/Pixel",                       /* IText */
  1159.    &tl_text                 /* NextText */
  1160. };
  1161.  
  1162.  
  1163. UBYTE ds_sbuf[20] = "1.0e0";
  1164. UBYTE ds_ubuf[20];
  1165.  
  1166. struct StringInfo ds_txstr = {
  1167.    ds_sbuf, ds_ubuf,                        /* Buffer, UndoBuffer  */
  1168.    0, 20, 0,                  /* BufferPos, MaxChars, DispPos */
  1169.    0, 5,                  /* UndoPos, NumChars */
  1170.    0, 0, 0,                  /* DispCount, CLeft, CTop */
  1171.    0x0, 1,                  /* LayerPtr, LongInt */
  1172.    NULL                   /* AltKeyMap */
  1173. };
  1174.  
  1175. struct Gadget ds = {
  1176.    &tl,                   /* NextGadget pointer */
  1177.    110, 45,                 /* LeftEdge, TopEdge  */
  1178.    88, 11,                 /* Width, Height       */
  1179.                      /* Gadget Flags */
  1180.    GADGHCOMP,
  1181.                      /* Activation Flags */
  1182.    RELVERIFY
  1183.  | STRINGCENTER,
  1184.                      /* GadgetType */
  1185.    STRGADGET
  1186.  | REQGADGET,
  1187.    (APTR)&ds_bord,                   /*  GadgetRender */
  1188.    NULL,                 /* SelectRender */
  1189.    NULL,                 /* GadgetText */
  1190.    0x0,                  /* MutualExclude */
  1191.    (APTR)&ds_txstr,                  /* SpecialInfo */
  1192.    DSGAD,                     /* GadgetID     */
  1193.    NULL                  /* UserData Pointer */
  1194. };
  1195.  
  1196.  
  1197. /*
  1198.  *      t_gadget
  1199.  */
  1200.  
  1201. SHORT t_Pairs[] = {
  1202.    0, 0,
  1203.    90,0,
  1204.    90,13,
  1205.    0, 13,
  1206.    0, 0
  1207. };
  1208.  
  1209. struct Border t_bord = {
  1210.    -1,    -3,                 /* LeftEdge, TopEdge */
  1211.    WHTPEN,REDPEN,JAM2,             /* FrontPen, BackPen, DrawMode*/
  1212.    5,                     /* Count of XY pairs */
  1213.    (SHORT *)&t_Pairs,                /* XY pairs */
  1214.    NULL                  /* Next Border */
  1215. };
  1216.  
  1217. struct IntuiText t_text = {
  1218.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1219.    JAM1,                /* DrawMode */
  1220.    10,34,                /* LeftEdge, TopEdge */
  1221.    &TxtAt_Plain,            /* TextAttr */
  1222.    "Real Time",                         /* IText */
  1223.    &ds_text                /* NextText */
  1224. };
  1225.  
  1226.  
  1227. UBYTE t_sbuf[12] = "0";
  1228. UBYTE t_ubuf[12];
  1229.  
  1230. struct StringInfo t_txstr = {
  1231.    t_sbuf, t_ubuf,                       /* Buffer, UndoBuffer  */
  1232.    0, 12, 0,                   /* BufferPos, MaxChars, DispPos */
  1233.    0, 1,                   /* UndoPos, NumChars */
  1234.    0, 0, 0,                   /* DispCount, CLeft, CTop */
  1235.    0x0, 0,                   /* LayerPtr, LongInt */
  1236.    NULL                    /* AltKeyMap */
  1237. };
  1238.  
  1239.  
  1240. struct Gadget t = {
  1241.    &ds,                            /* NextGadget pointer */
  1242.    110, 32,            /* LeftEdge, TopEdge  */
  1243.    88, 11,            /* Width, Height      */
  1244.                 /* Gadget Flags */
  1245.    GADGHCOMP,
  1246.                 /* Activation Flags */
  1247.    RELVERIFY
  1248.  | LONGINT
  1249.  | STRINGCENTER,
  1250.                 /* GadgetType */
  1251.    STRGADGET
  1252.  | REQGADGET,
  1253.    (APTR)&t_bord,               /*  GadgetRender */
  1254.    NULL,            /* SelectRender */
  1255.    NULL,            /* GadgetText */
  1256.    0x0,             /* MutualExclude */
  1257.    (APTR)&t_txstr,              /* SpecialInfo */
  1258.    TGAD,                 /* GadgetID */
  1259.    NULL             /* UserData Pointer */
  1260. };
  1261.  
  1262.  
  1263. /*
  1264.  *    G gadget
  1265.  */
  1266.  
  1267. SHORT G_Pairs[] = {
  1268.    0, 0,
  1269.    90,0,
  1270.    90,13,
  1271.    0, 13,
  1272.    0, 0
  1273. };
  1274.  
  1275. struct Border G_bord = {
  1276.    -1,    -3,              /* LeftEdge, TopEdge */
  1277.    WHTPEN,REDPEN,JAM2,          /* FrontPen, BackPen, DrawMode*/
  1278.    5,                  /* Count of XY pairs */
  1279.    (SHORT *)&G_Pairs,             /* XY pairs */
  1280.    NULL               /* Next Border */
  1281. };
  1282.  
  1283. struct IntuiText G_text = {
  1284.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1285.    JAM1,                /* DrawMode */
  1286.    10,8,                            /* LeftEdge, TopEdge */
  1287.    &TxtAt_Plain,            /* TextAttr */
  1288.    "Gravity (G)",                       /* IText */
  1289.    &t_text                /* NextText */
  1290. };
  1291.  
  1292. UBYTE G_sbuf[20] = "6.67e0";
  1293. UBYTE G_ubuf[20];
  1294.  
  1295. struct StringInfo G_txstr = {
  1296.    G_sbuf, G_ubuf,                /* Buffer, UndoBuffer */
  1297.    0, 20, 0,                /* BufferPos, MaxChars, DispPos */
  1298.    0, 6,                /* UndoPos, NumChars */
  1299.    0, 0, 0,                /* DispCount, CLeft, CTop */
  1300.    0x0, 0,                /* LayerPtr, LongInt */
  1301.    NULL                 /* AltKeyMap */
  1302. };
  1303.  
  1304. struct Gadget G = {
  1305.    &t,                      /* NextGadget pointer */
  1306.    110, 6,            /* LeftEdge, TopEdge  */
  1307.    88, 11,            /* Width, Height      */
  1308.                 /* Gadget Flags */
  1309.    GADGHCOMP,
  1310.                 /* Activation Flags */
  1311.    RELVERIFY
  1312.  | STRINGCENTER,
  1313.                 /* GadgetType */
  1314.    STRGADGET
  1315.  | REQGADGET,
  1316.    (APTR)&G_bord,               /* GadgetRender */
  1317.    NULL,            /* SelectRender */
  1318.    NULL,            /* GadgetText */
  1319.    0x0,             /* MutualExclude */
  1320.    (APTR)&G_txstr,              /* SpecialInfo */
  1321.    GGAD,            /* GadgetID */
  1322.    NULL             /* UserData Pointer */
  1323. };
  1324.  
  1325.  
  1326.  
  1327.  
  1328. /*
  1329.  *      dt gadget
  1330.  */
  1331.  
  1332. SHORT dt_Pairs[] = {
  1333.    0, 0,
  1334.    90,0,
  1335.    90,13,
  1336.    0, 13,
  1337.    0, 0
  1338. };
  1339.  
  1340. struct Border dt_bord = {
  1341.    -1,    -3,              /* LeftEdge, TopEdge */
  1342.    WHTPEN,REDPEN,JAM2,          /* FrontPen, BackPen, DrawMode*/
  1343.    5,                  /* Count of XY pairs */
  1344.    (SHORT *)&dt_Pairs,            /* XY pairs */
  1345.    NULL               /* Next Border */
  1346. };
  1347.  
  1348. struct IntuiText dt_text = {
  1349.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1350.    JAM1,                /* DrawMode */
  1351.    10,21,                /* LeftEdge, TopEdge */
  1352.    &TxtAt_Plain,            /* TextAttr */
  1353.    "Sim Time",                          /* IText */
  1354.    &G_text                              /* NextText */
  1355. };
  1356.  
  1357. UBYTE dt_sbuf[20] = "1.0e0";
  1358. UBYTE dt_ubuf[20];
  1359.  
  1360. struct StringInfo dt_txstr = {
  1361.    dt_sbuf, dt_ubuf,               /* Buffer, UndoBuffer */
  1362.    0, 20, 0,                /* BufferPos, MaxChars, DispPos */
  1363.    0, 5,                /* UndoPos, NumChars */
  1364.    0, 0, 0,                /* DispCount, CLeft, CTop */
  1365.    0x0, 1,                /* LayerPtr, LongInt */
  1366.    NULL                 /* AltKeyMap */
  1367. };
  1368.  
  1369. struct Gadget dt = {
  1370.    &G,                  /* NextGadget pointer */
  1371.    110, 19,            /* LeftEdge, TopEdge  */
  1372.    88, 11,            /* Width, Height      */
  1373.                 /* Gadget Flags */
  1374.    GADGHCOMP,
  1375.                 /* Activation Flags */
  1376.    RELVERIFY
  1377.  | STRINGCENTER,
  1378.                 /* GadgetType */
  1379.    STRGADGET
  1380.  | REQGADGET,
  1381.    (APTR)&dt_bord,              /* GadgetRender */
  1382.    NULL,            /* SelectRender */
  1383.    NULL,            /* GadgetText */
  1384.    0x0,             /* MutualExclude */
  1385.    (APTR)&dt_txstr,             /* SpecialInfo */
  1386.    DTGAD,             /* GadgetID */
  1387.    NULL             /* UserData Pointer */
  1388. };
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394. /*
  1395.  *     FileName cancel gadget
  1396.  */
  1397.  
  1398. SHORT fncancel_Pairs[] = {
  1399.    0, 0,
  1400.    68,0,
  1401.    68,22,
  1402.    0, 22,
  1403.    0, 0
  1404. };
  1405.  
  1406. struct Border fncancel_bord = {
  1407.    -1,    -1,                /* LeftEdge, TopEdge */
  1408.    REDPEN,REDPEN,JAM2,            /* FrontPen, BackPen, DrawMode */
  1409.    5,                    /* Count of XY pairs */
  1410.    (SHORT *)&fncancel_Pairs,              /* XY pairs */
  1411.    NULL                 /* Next Border */
  1412. };
  1413.  
  1414. struct IntuiText fncancel_text = {
  1415.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1416.    JAM1,                /* DrawMode */
  1417.    9,8,                 /* LeftEdge, TopEdge */
  1418.    &TxtAt_Plain,            /* TextAttr */
  1419.    "CANCEL",                            /* IText */
  1420.    NULL                 /* NextText */
  1421. };
  1422.  
  1423. struct Gadget fncancel = {
  1424.    NULL,            /* NextGadget pointer */
  1425.    230, 35,            /* LeftEdge, TopEdge  */
  1426.    68, 22,            /* Width, Height      */
  1427.                 /* Gadget Flags */
  1428.    GADGHCOMP,
  1429.                 /* Activation Flags */
  1430.    RELVERIFY
  1431.  | ENDGADGET,
  1432.                 /* GadgetType */
  1433.    BOOLGADGET
  1434.  | REQGADGET,
  1435.    (APTR)&fncancel_bord,          /* GadgetRender */
  1436.    NULL,            /* SelectRender */
  1437.    &fncancel_text,        /* GadgetText */
  1438.    0x0,             /* MutualExclude */
  1439.    NULL,            /* SpecialInfo */
  1440.    FNCANGAD,            /* GadgetID        */
  1441.    NULL             /* UserData Pointer */
  1442. };
  1443.  
  1444.  
  1445. /*
  1446.  *    fnok gadget
  1447.  */
  1448.  
  1449. SHORT fnok_Pairs[] = {
  1450.    0, 0,
  1451.    30,0,
  1452.    30,22,
  1453.    0, 22,
  1454.    0, 0
  1455. };
  1456.  
  1457. struct Border fnok_bord = {
  1458.    -1,    -1,               /* LeftEdge, TopEdge */
  1459.    GRNPEN,REDPEN,JAM2,           /* FrontPen, BackPen, DrawMode*/
  1460.    5,                   /* Count of XY pairs */
  1461.    (SHORT *)&fnok_Pairs,         /* XY pairs */
  1462.    NULL                /* Next Border */
  1463. };
  1464.  
  1465. struct IntuiText fnok_text = {
  1466.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1467.    JAM1,                /* DrawMode */
  1468.    5,7,                 /* LeftEdge, TopEdge */
  1469.    &TxtAt_Plain,            /* TextAttr */
  1470.    "OK",                                /* IText */
  1471.    NULL                 /* NextText */
  1472. };
  1473.  
  1474.  
  1475. struct Gadget fnok = {
  1476.    &fncancel,              /* NextGadget pointer */
  1477.    100, 35,              /* LeftEdge, TopEdge    */
  1478.    30, 22,              /* Width, Height    */
  1479.                   /* Gadget Flags */
  1480.    GADGHCOMP,
  1481.                   /* Activation Flags */
  1482.    RELVERIFY
  1483.  | ENDGADGET,
  1484.                   /* GadgetType */
  1485.    BOOLGADGET
  1486.  | REQGADGET,
  1487.    (APTR)&fnok_bord,                /*  GadgetRender */
  1488.    NULL,              /* SelectRender */
  1489.    &fnok_text,              /* GadgetText */
  1490.    0x0,               /* MutualExclude */
  1491.    NULL,              /* SpecialInfo */
  1492.    FNOKGAD,              /* GadgetID          */
  1493.    NULL               /* UserData Pointer */
  1494. };
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500. /*
  1501.  *     FileName gadget
  1502.  */
  1503.  
  1504. SHORT fn_Pairs[] = {
  1505.    0, 0,
  1506.    300,0,
  1507.    300,10,
  1508.    0, 10,
  1509.    0, 0
  1510. };
  1511.  
  1512. struct Border fn_bord = {
  1513.    -1,    -1,                /* LeftEdge, TopEdge */
  1514.    YLWPEN,REDPEN,JAM2,            /* FrontPen, BackPen, DrawMode*/
  1515.    5,                    /* Count of XY pairs */
  1516.    (SHORT *)&fn_Pairs,              /* XY pairs */
  1517.    NULL                 /* Next Border */
  1518. };
  1519.  
  1520. struct IntuiText fn_text = {
  1521.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1522.    JAM1,                /* DrawMode */
  1523.    140,5,                /* LeftEdge, TopEdge */
  1524.    &TxtAt_Plain,            /* TextAttr */
  1525.    "Data File Name?",                   /* IText */
  1526.    NULL                  /* NextText */
  1527. };
  1528.  
  1529.  
  1530. UBYTE fn_sbuf[100] = "CM.DAT";
  1531. UBYTE fn_ubuf[100];
  1532.  
  1533. struct StringInfo fn_txstr = {
  1534.    fn_sbuf, fn_ubuf,                        /* Buffer, UndoBuffer  */
  1535.    0, 100, 0,                  /* BufferPos, MaxChars, DispPos */
  1536.    0, 6,                  /* UndoPos, NumChars */
  1537.    0, 0, 0,                  /* DispCount, CLeft, CTop */
  1538.    0x0, 0,                  /* LayerPtr, LongInt */
  1539.    NULL                   /* AltKeyMap */
  1540. };
  1541.  
  1542. struct Gadget fn = {
  1543.    &fnok,                   /* NextGadget pointer */
  1544.    50, 20,                 /* LeftEdge, TopEdge  */
  1545.    300, 10,                 /* Width, Height       */
  1546.                      /* Gadget Flags */
  1547.    GADGHCOMP,
  1548.                      /* Activation Flags */
  1549.    RELVERIFY
  1550.  | ENDGADGET
  1551.  | STRINGCENTER,
  1552.                      /* GadgetType */
  1553.    STRGADGET
  1554.  | REQGADGET,
  1555.    (APTR)&fn_bord,                   /* GadgetRender */
  1556.    NULL,                 /* SelectRender */
  1557.    NULL,                 /* GadgetText */
  1558.    0x0,                  /* MutualExclude */
  1559.    (APTR)&fn_txstr,                  /* SpecialInfo */
  1560.    FNGAD,                     /* GadgetID     */
  1561.    NULL                  /* UserData Pointer */
  1562. };
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568. /*
  1569.  *     aok gadget
  1570.  */
  1571.  
  1572.  
  1573. SHORT aok_Pairs[] = {
  1574.    0, 0,
  1575.    25,0,
  1576.    25,12,
  1577.    0, 12,
  1578.    0, 0
  1579. };
  1580.  
  1581. struct Border aok_bord = {
  1582.    -1,    -1,               /* LeftEdge, TopEdge */
  1583.    GRNPEN,REDPEN,JAM2,           /* FrontPen, BackPen, DrawMode*/
  1584.    5,                   /* Count of XY p    airs */
  1585.    (SHORT *)&aok_Pairs,        /* XY pairs */
  1586.    NULL                /* Next Border */
  1587. };
  1588.  
  1589. struct IntuiText aok_text = {
  1590.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1591.    JAM1,                /* DrawMode */
  1592.    5,2,                 /* LeftEdge, TopEdge */
  1593.    &TxtAt_Plain,            /* TextAttr */
  1594.    "OK",                                /* IText */
  1595.    NULL                 /* NextText */
  1596. };
  1597.  
  1598.  
  1599. struct IntuiText A_text6 = {
  1600.    ORGPEN,REDPEN,            /* FrontPen, BackPen */
  1601.    JAM1,                /* DrawMode */
  1602.    25,11,                /* LeftEdge, TopEdge */
  1603.    &TxtAt_BI,                 /* TextAttr */
  1604.    "Celestial Mechanics",               /* IText */
  1605.    NULL                  /* NextText */
  1606. };
  1607.  
  1608. struct IntuiText A_text5 = {
  1609.    ORGPEN,REDPEN,            /* FrontPen, BackPen */
  1610.    JAM1,                /* DrawMode */
  1611.    25,21,                /* LeftEdge, TopEdge */
  1612.    &TxtAt_BI,                 /* TextAttr */
  1613.    "     Simulator     ",               /* IText */
  1614.    &A_text6                  /* NextText */
  1615. };
  1616.  
  1617. struct IntuiText A_text4 = {
  1618.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1619.    JAM1,                /* DrawMode */
  1620.    25,38,                /* LeftEdge, TopEdge */
  1621.    &TxtAt_Plain,             /* TextAttr */
  1622.    "  W. John Guineau  ",               /* IText */
  1623.    &A_text5                  /* NextText */
  1624. };
  1625.  
  1626. struct IntuiText A_text3 = {
  1627.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1628.    JAM1,                /* DrawMode */
  1629.    25,46,                /* LeftEdge, TopEdge */
  1630.    &TxtAt_Plain,             /* TextAttr */
  1631.    "3 Royal Crest Dr #0",               /* IText */
  1632.    &A_text4                  /* NextText */
  1633. };
  1634.  
  1635. struct IntuiText A_text2 = {
  1636.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1637.    JAM1,                /* DrawMode */
  1638.    25,54,                /* LeftEdge, TopEdge */
  1639.    &TxtAt_Plain,             /* TextAttr */
  1640.    " Marlboro, Ma 01752",               /* IText */
  1641.    &A_text3                  /* NextText */
  1642. };
  1643.  
  1644. struct IntuiText A_text = {
  1645.    WHTPEN,REDPEN,            /* FrontPen, BackPen */
  1646.    JAM1,                /* DrawMode */
  1647.    25,62,                /* LeftEdge, TopEdge */
  1648.    &TxtAt_Plain,                 /* TextAttr */
  1649.    "  (508) 485-6233   ",               /* IText */
  1650.    &A_text2                  /* NextText */
  1651. };
  1652.  
  1653.  
  1654. struct Gadget aok = {
  1655.    NULL,                   /* NextGadget pointer */
  1656.    85, 82,                 /* LeftEdge, TopEdge  */
  1657.    23, 10,                 /* Width, Height       */
  1658.                      /* Gadget Flags */
  1659.    GADGHCOMP,
  1660.                      /* Activation Flags */
  1661.    RELVERIFY
  1662.  | ENDGADGET,
  1663.                      /* GadgetType */
  1664.    BOOLGADGET
  1665.  | REQGADGET,
  1666.    (APTR)&aok_bord,                  /* GadgetRender */
  1667.    NULL,                 /* SelectRender */
  1668.    &aok_text,                 /* GadgetText */
  1669.    0x0,                  /* MutualExclude */
  1670.    NULL,                             /* SpecialInfo */
  1671.    AOKGAD,                     /* GadgetID     */
  1672.    NULL                  /* UserData Pointer */
  1673. };
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681. /***********************************************************
  1682.  *
  1683.  *    MENUS
  1684.  *
  1685.  ***********************************************************/
  1686.  
  1687.  
  1688. /*
  1689.  * MenuNumber component definitions
  1690.  */
  1691. #define M_Control 0
  1692. #define I_Stop      0
  1693. #define I_Start   1
  1694.  
  1695. #define M_Edit      1
  1696. #define I_ClearB  0
  1697. #define I_ClearS  1
  1698. #define I_Modify  2
  1699. #define I_Create  3
  1700. #define I_Setup   4
  1701.  
  1702. #define M_File      2
  1703. #define I_Exit      0
  1704. #define I_SavScr  1
  1705. #define I_SavDat  2
  1706. #define I_LoadDat 3
  1707. #define I_About   4
  1708.  
  1709. /*
  1710.  *  MenuNumber Shortcuts
  1711.  */
  1712. #define MN_CStop   (SHIFTMENU(M_Control)|SHIFTITEM(I_Stop)|SHIFTSUB(NOSUB))
  1713. #define MN_CStart  (SHIFTMENU(M_Control)|SHIFTITEM(I_Start)|SHIFTSUB(NOSUB))
  1714.  
  1715. #define MN_ESetup  (SHIFTMENU(M_Edit)|SHIFTITEM(I_Setup)|SHIFTSUB(NOSUB))
  1716. #define MN_ECreate (SHIFTMENU(M_Edit)|SHIFTITEM(I_Create)|SHIFTSUB(NOSUB))
  1717. #define MN_EMod    (SHIFTMENU(M_Edit)|SHIFTITEM(I_Modify)|SHIFTSUB(NOSUB))
  1718. #define MN_EClearS (SHIFTMENU(M_Edit)|SHIFTITEM(I_ClearS)|SHIFTSUB(NOSUB))
  1719. #define MN_EClearB (SHIFTMENU(M_Edit)|SHIFTITEM(I_ClearB)|SHIFTSUB(NOSUB))
  1720.  
  1721. #define MN_FAbout  (SHIFTMENU(M_File)|SHIFTITEM(I_About)|SHIFTSUB(NOSUB))
  1722. #define MN_FLDat   (SHIFTMENU(M_File)|SHIFTITEM(I_LoadDat)|SHIFTSUB(NOSUB))
  1723. #define MN_FSDat   (SHIFTMENU(M_File)|SHIFTITEM(I_SavDat)|SHIFTSUB(NOSUB))
  1724. #define MN_FSScr   (SHIFTMENU(M_File)|SHIFTITEM(I_SavScr)|SHIFTSUB(NOSUB))
  1725. #define MN_FExit   (SHIFTMENU(M_File)|SHIFTITEM(I_Exit)|SHIFTSUB(NOSUB))
  1726.  
  1727.  
  1728.  
  1729. /*
  1730.  * "File" menu subitems
  1731.  */
  1732. struct IntuiText AboutTxt = {
  1733.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1734.    JAM1,                /* DrawMode */
  1735.    0,0,                 /* LeftEdge, TopEdge */
  1736.    &TxtAt_Plain,            /* TextAttr */
  1737.    "About",                             /* IText */
  1738.    NULL                 /* NextText */
  1739. };
  1740.  
  1741. struct MenuItem About = {
  1742.    NULL,            /* next item */
  1743.    0,0,100,10,            /* Left,Top Edge, Width, Height */
  1744.    ITEMENABLED            /* flags */
  1745.  | ITEMTEXT
  1746.  | HIGHCOMP,
  1747.    0L,                /* MutualExclude */
  1748.    (APTR)&AboutTxt,         /* Name */
  1749.    0,                /* Command */
  1750.    NULL,            /* SubItem */
  1751.    0                /* NextSelect */
  1752. };
  1753.  
  1754. struct IntuiText LoadTxt = {
  1755.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1756.    JAM1,                /* DrawMode */
  1757.    0,0,                 /* LeftEdge, TopEdge */
  1758.    &TxtAt_Plain,            /* TextAttr */
  1759.    "Load Data",                         /* IText */
  1760.    NULL                 /* NextText */
  1761. };
  1762.  
  1763. struct MenuItem LoadData = {
  1764.    &About,            /* next item */
  1765.    0,10,100,10,         /* Left,Top Edge, Width, Height */
  1766.    ITEMENABLED            /* flags */
  1767.  | ITEMTEXT
  1768.  | HIGHCOMP,
  1769.    0L,                /* MutualExclude */
  1770.    (APTR)&LoadTxt,          /* Name */
  1771.    0,                /* Command */
  1772.    NULL,            /* SubItem */
  1773.    0                /* NextSelect */
  1774. };
  1775.  
  1776. struct IntuiText SaveDTxt = {
  1777.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1778.    JAM1,                /* DrawMode */
  1779.    0,0,                 /* LeftEdge, TopEdge */
  1780.    &TxtAt_Plain,            /* TextAttr */
  1781.    "Save Data",                         /* IText */
  1782.    NULL                 /* NextText */
  1783. };
  1784.  
  1785. struct MenuItem SaveData = {
  1786.    &LoadData,            /* next item */
  1787.    0,20,100,10,         /* Left,Top Edge, Width, Height */
  1788.    ITEMENABLED            /* flags */
  1789.  | ITEMTEXT
  1790.  | HIGHCOMP,
  1791.    0L,                /* MutualExclude */
  1792.    (APTR)&SaveDTxt,         /* Name */
  1793.    0,                /* Command */
  1794.    NULL,            /* SubItem */
  1795.    0                /* NextSelect */
  1796. };
  1797.  
  1798. struct IntuiText SaveSTxt = {
  1799.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1800.    JAM1,                /* DrawMode */
  1801.    0,0,                 /* LeftEdge, TopEdge */
  1802.    &TxtAt_Plain,            /* TextAttr */
  1803.    "Save Screen",                       /* IText */
  1804.    NULL                 /* NextText */
  1805. };
  1806.  
  1807. struct MenuItem SaveScreen = {
  1808.    &SaveData,            /* next item */
  1809.    0,30,100,10,         /* Left,Top Edge, Width, Height */
  1810.    ITEMENABLED            /* flags */
  1811.  | ITEMTEXT
  1812.  | HIGHCOMP,
  1813.    0L,                /* MutualExclude */
  1814.    (APTR)&SaveSTxt,         /* Name */
  1815.    0,                /* Command */
  1816.    NULL,            /* SubItem */
  1817.    0                /* NextSelect */
  1818. };
  1819.  
  1820. struct IntuiText ExitTxt = {
  1821.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1822.    JAM1,                /* DrawMode */
  1823.    0,0,                 /* LeftEdge, TopEdge */
  1824.    &TxtAt_Plain,            /* TextAttr */
  1825.    "Exit",                              /* IText */
  1826.    NULL                 /* NextText */
  1827. };
  1828.  
  1829. struct MenuItem Exit = {
  1830.    &SaveScreen,         /* next item */
  1831.    0,40,100,10,         /* Left,Top Edge, Width, Height */
  1832.    ITEMENABLED            /* flags */
  1833.  | ITEMTEXT
  1834.  | HIGHCOMP,
  1835.    0L,                /* MutualExclude */
  1836.    (APTR)&ExitTxt,          /* Name */
  1837.    0,                /* Command */
  1838.    NULL,            /* SubItem */
  1839.    0                /* NextSelect */
  1840. };
  1841.  
  1842.  
  1843.  
  1844. /*
  1845.  * "Edit" menu subitems
  1846.  */
  1847. struct IntuiText SetupTxt = {
  1848.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1849.    JAM1,                /* DrawMode */
  1850.    0,0,                 /* LeftEdge, TopEdge */
  1851.    &TxtAt_Plain,            /* TextAttr */
  1852.    "Setup...",                          /* IText */
  1853.    NULL                 /* NextText */
  1854. };
  1855.  
  1856. struct MenuItem Setup = {
  1857.    NULL,            /* next item */
  1858.    0,0,100,10,            /* Left,Top Edge, Width, Height */
  1859.    ITEMENABLED            /* flags */
  1860.  | ITEMTEXT
  1861.  | HIGHCOMP,
  1862.    0L,                /* MutualExclude */
  1863.    (APTR)&SetupTxt,         /* Name */
  1864.    0,                /* Command */
  1865.    NULL,            /* SubItem */
  1866.    0                /* NextSelect */
  1867. };
  1868.  
  1869. struct IntuiText CreateTxt = {
  1870.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1871.    JAM1,                /* DrawMode */
  1872.    0,0,                 /* LeftEdge, TopEdge */
  1873.    &TxtAt_Plain,            /* TextAttr */
  1874.    "Create...",                         /* IText */
  1875.    NULL                 /* NextText */
  1876. };
  1877.  
  1878. struct MenuItem Create = {
  1879.    &Setup,            /* next item */
  1880.    0,10,100,10,            /* Left,Top Edge, Width, Height */
  1881.    ITEMENABLED            /* flags */
  1882.  | ITEMTEXT
  1883.  | HIGHCOMP,
  1884.    0L,                /* MutualExclude */
  1885.    (APTR)&CreateTxt,        /* Name */
  1886.    0,                /* Command */
  1887.    NULL,            /* SubItem */
  1888.    0                /* NextSelect */
  1889. };
  1890.  
  1891. struct IntuiText ModifyTxt = {
  1892.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1893.    JAM1,                /* DrawMode */
  1894.    0,0,                 /* LeftEdge, TopEdge */
  1895.    &TxtAt_Plain,            /* TextAttr */
  1896.    "Modify...",                         /* IText */
  1897.    NULL                 /* NextText */
  1898. };
  1899.  
  1900. struct MenuItem Modify = {
  1901.    &Create,            /* next item */
  1902.    0,20,100,10,         /* Left,Top Edge, Width, Height */
  1903.    ITEMENABLED            /* flags */
  1904.  | ITEMTEXT
  1905.  | HIGHCOMP,
  1906.    0L,                /* MutualExclude */
  1907.    (APTR)&ModifyTxt,        /* Name */
  1908.    0,                /* Command */
  1909.    NULL,            /* SubItem */
  1910.    0                /* NextSelect */
  1911. };
  1912.  
  1913. struct IntuiText ClearSTxt = {
  1914.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1915.    JAM1,                /* DrawMode */
  1916.    0,0,                 /* LeftEdge, TopEdge */
  1917.    &TxtAt_Plain,            /* TextAttr */
  1918.    "Clear Screen",                      /* IText */
  1919.    NULL                 /* NextText */
  1920. };
  1921.  
  1922. struct MenuItem ClearS = {
  1923.    &Modify,            /* next item */
  1924.    0,30,100,10,         /* Left,Top Edge, Width, Height */
  1925.    ITEMENABLED            /* flags */
  1926.  | ITEMTEXT
  1927.  | HIGHCOMP,
  1928.    0L,                /* MutualExclude */
  1929.    (APTR)&ClearSTxt,        /* Name */
  1930.    0,                /* Command */
  1931.    NULL,            /* SubItem */
  1932.    0                /* NextSelect */
  1933. };
  1934.  
  1935. struct IntuiText ClearBTxt = {
  1936.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1937.    JAM1,                /* DrawMode */
  1938.    0,0,                 /* LeftEdge, TopEdge */
  1939.    &TxtAt_Plain,            /* TextAttr */
  1940.    "Clear Bodys",                       /* IText */
  1941.    NULL                 /* NextText */
  1942. };
  1943.  
  1944. struct MenuItem ClearB = {
  1945.    &ClearS,            /* next item */
  1946.    0,40,100,10,         /* Left,Top Edge, Width, Height */
  1947.    ITEMENABLED            /* flags */
  1948.  | ITEMTEXT
  1949.  | HIGHCOMP,
  1950.    0L,                /* MutualExclude */
  1951.    (APTR)&ClearBTxt,        /* Name */
  1952.    0,                /* Command */
  1953.    NULL,            /* SubItem */
  1954.    0                /* NextSelect */
  1955. };
  1956.  
  1957.  
  1958.  
  1959. /*
  1960.  * "Control" menu subitems
  1961.  */
  1962.  
  1963. struct IntuiText StartTxt = {
  1964.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1965.    JAM1,                /* DrawMode */
  1966.    0,0,                 /* LeftEdge, TopEdge */
  1967.    &TxtAt_Plain,            /* TextAttr */
  1968.    "Start",                             /* IText */
  1969.    NULL                 /* NextText */
  1970. };
  1971.  
  1972. struct MenuItem Start = {
  1973.    NULL,            /* next item */
  1974.    0,0,100,10,                 /* Left,Top Edge, Width, Height */
  1975.    ITEMENABLED            /* flags */
  1976.  | ITEMTEXT
  1977.  | HIGHCOMP,
  1978.    0L,                /* MutualExclude */
  1979.    (APTR)&StartTxt,         /* Name */
  1980.    0,                /* Command */
  1981.    NULL,            /* SubItem */
  1982.    0                /* NextSelect */
  1983. };
  1984.  
  1985. struct IntuiText StopTxt = {
  1986.    BLKPEN,WHTPEN,            /* FrontPen, BackPen */
  1987.    JAM1,                /* DrawMode */
  1988.    0,0,                 /* LeftEdge, TopEdge */
  1989.    &TxtAt_Plain,            /* TextAttr */
  1990.    "Stop",                              /* IText */
  1991.    NULL                 /* NextText */
  1992. };
  1993.  
  1994. struct MenuItem Stop = {
  1995.    &Start,            /* next item */
  1996.    0,10,100,10,         /* Left,Top Edge, Width, Height */
  1997.    ITEMENABLED            /* flags */
  1998.  | ITEMTEXT
  1999.  | HIGHCOMP,
  2000.    0L,                /* MutualExclude */
  2001.    (APTR)&StopTxt,          /* Name */
  2002.    0,                /* Command */
  2003.    NULL,            /* SubItem */
  2004.    0                /* NextSelect */
  2005. };
  2006.  
  2007.  
  2008.  
  2009. /*
  2010.  *   Actual Menus
  2011.  */
  2012. struct Menu File = {
  2013.    NULL,            /* NextMenu */
  2014.    0,0,50,0,            /* Left,Top Edge, Width, Height */
  2015.    MENUENABLED,         /* flags */
  2016.    "File",                  /* Name */
  2017.    &Exit            /* First Item */
  2018.  
  2019. };
  2020.  
  2021. struct Menu Edit = {
  2022.    &File,            /* NextMenu */
  2023.    50,0,50,0,            /* Left,Top Edge, Width, Height */
  2024.    MENUENABLED,         /* flags */
  2025.    "Edit",                  /* Name */
  2026.    &ClearB            /* First Item */
  2027.  
  2028. };
  2029.  
  2030. struct Menu Control = {
  2031.    &Edit,            /* NextMenu */
  2032.    100,0,90,0,            /* Left,Top Edge, Width, Height */
  2033.    MENUENABLED,         /* flags */
  2034.    "Control",               /* Name */
  2035.    &Stop            /* First Item */
  2036.  
  2037. };
  2038.  
  2039.  
  2040.  
  2041.  
  2042. /********************************************************
  2043.  *  Requesters
  2044.  ********************************************************/
  2045.  
  2046.  
  2047.  
  2048.  
  2049. SHORT req_Pairs[] = {
  2050.   0,      0,
  2051.   209,      0,
  2052.   209,      149,
  2053.   0,      149,
  2054.   0,      0
  2055. };
  2056.  
  2057. struct Border req_bord = {
  2058.   0,  0,                   /* LeftEdge, TopEdge */
  2059.   PURPEN,ORGPEN,JAM2,               /* FrontPen, BackPen, DrawMode*/
  2060.   5,                       /* Count of XY pairs */
  2061.   (SHORT *)&req_Pairs,                 /* XY pairs */
  2062.   NULL                       /* Next Border */
  2063. };
  2064.  
  2065.  
  2066.  
  2067. SHORT fnr_Pairs[] = {
  2068.   0,      0,
  2069.   399,      0,
  2070.   399,      59,
  2071.   0,      59,
  2072.   0,      0
  2073. };
  2074.  
  2075. struct Border fnr_bord = {
  2076.   0,  0,                   /* LeftEdge, TopEdge */
  2077.   PURPEN,ORGPEN,JAM2,               /* FrontPen, BackPen, DrawMode*/
  2078.   5,                       /* Count of XY pairs */
  2079.   (SHORT *)&fnr_Pairs,                 /* XY pairs */
  2080.   NULL                       /* Next Border */
  2081. };
  2082.  
  2083.  
  2084.  
  2085. SHORT A_Pairs2[] = {
  2086.   4,      4,
  2087.   195,      4,
  2088.   195,      95,
  2089.   4,      95,
  2090.   4,      4
  2091. };
  2092.  
  2093. struct Border A_bord2 = {
  2094.   0,  0,                   /* LeftEdge, TopEdge */
  2095.   GRNPEN,BLUPEN,JAM2,               /* FrontPen, BackPen, DrawMode*/
  2096.   5,                       /* Count of XY pairs */
  2097.   (SHORT *)&A_Pairs2,                  /* XY pairs */
  2098.   NULL                       /* Next Border */
  2099. };
  2100.  
  2101. SHORT A_Pairs[] = {
  2102.   0,      0,
  2103.   199,      0,
  2104.   199,      99,
  2105.   0,      99,
  2106.   0,      0
  2107. };
  2108.  
  2109. struct Border A_bord = {
  2110.   0,  0,                   /* LeftEdge, TopEdge */
  2111.   REDPEN,GRNPEN,JAM2,               /* FrontPen, BackPen, DrawMode*/
  2112.   5,                       /* Count of XY pairs */
  2113.   (SHORT *)&A_Pairs,                   /* XY pairs */
  2114.   &A_bord2                   /* Next Border */
  2115. };
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121. struct Requester BodyInfo = {
  2122.    NULL,            /* OlderRequester */
  2123.    200,100,            /* LeftEdge,TopEdge */
  2124.    210,150,            /* Width Height */
  2125.    0,0,             /* RelLeft,RelTop */
  2126.    &mass,            /* gadgets */
  2127.    &req_bord,            /* ReqBorder */
  2128.    &mass_text,            /* text */
  2129.    NULL,            /* Flags */
  2130.    REQBCK,            /* BackFill (pen) */
  2131.    NULL,            /* ReqLayer */
  2132.    {NULL},            /* pad */
  2133.    {NULL},            /* ImageBMap */
  2134.    NULL,            /* RWindow */
  2135.    {NULL}            /* pad */
  2136. };
  2137.  
  2138.  
  2139. struct Requester SetupInfo = {
  2140.    NULL,            /* OlderRequester */
  2141.    200,100,            /* LeftEdge,TopEdge */
  2142.    210,150,            /* Width Height */
  2143.    0,0,             /* RelLeft,RelTop */
  2144.    &dt,                         /* gadgets */
  2145.    &req_bord,            /* ReqBorder */
  2146.    &dt_text,            /* text */
  2147.    NULL,            /* Flags */
  2148.    REQBCK,            /* BackFill (pen) */
  2149.    NULL,            /* ReqLayer */
  2150.    {NULL},            /* pad */
  2151.    {NULL},            /* ImageBMap */
  2152.    NULL,            /* RWindow */
  2153.    {NULL}            /* pad */
  2154. };
  2155.  
  2156.  
  2157. struct Requester FileName = {
  2158.    NULL,            /* OlderRequester */
  2159.    100,100,            /* LeftEdge,TopEdge */
  2160.    400,60,            /* Width Height */
  2161.    0,0,             /* RelLeft,RelTop */
  2162.    &fn,                         /* gadgets */
  2163.    &fnr_bord,            /* ReqBorder */
  2164.    &fn_text,            /* text */
  2165.    NULL,            /* Flags */
  2166.    REQBCK,            /* BackFill (pen) */
  2167.    NULL,            /* ReqLayer */
  2168.    {NULL},            /* pad */
  2169.    {NULL},            /* ImageBMap */
  2170.    NULL,            /* RWindow */
  2171.    {NULL}            /* pad */
  2172. };
  2173.  
  2174.  
  2175. struct Requester RAbout = {
  2176.    NULL,            /* OlderRequester */
  2177.    200,100,            /* LeftEdge,TopEdge */
  2178.    200,100,            /* Width Height */
  2179.    0,0,             /* RelLeft,RelTop */
  2180.    &aok,                        /* gadgets */
  2181.    &A_bord,            /* ReqBorder */
  2182.    &A_text,            /* text */
  2183.    NULL,            /* Flags */
  2184.    BLUPEN,            /* BackFill (pen) */
  2185.    NULL,            /* ReqLayer */
  2186.    {NULL},            /* pad */
  2187.    {NULL},            /* ImageBMap */
  2188.    NULL,            /* RWindow */
  2189.    {NULL}            /* pad */
  2190. };
  2191.  
  2192.  
  2193.  
  2194.